

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=auto>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/img/favicon.png">
  <link rel="icon" href="/img/favicon.png">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="description" content="">
  <meta name="author" content="Veen">
  <meta name="keywords" content="">
  <meta name="description" content="fvSchemesfoamSearch $FOAM_TUTORIALS fvSchemes ddtSchemes.default foamSearch $FOAM_TUTORIALS fvSchemes gradSchemes foamSearch $FOAM_TUTORIALS fvSchemes &quot;divSchemes.div(phi,U)&quot; foamSearch $FOAM_TUTORIAL">
<meta property="og:type" content="website">
<meta property="og:title" content="OpenFOAM Notes">
<meta property="og:url" content="https://veenxz.github.io/OpenFOAM/OpenFOAM-Tips.html">
<meta property="og:site_name" content="Veen">
<meta property="og:description" content="fvSchemesfoamSearch $FOAM_TUTORIALS fvSchemes ddtSchemes.default foamSearch $FOAM_TUTORIALS fvSchemes gradSchemes foamSearch $FOAM_TUTORIALS fvSchemes &quot;divSchemes.div(phi,U)&quot; foamSearch $FOAM_TUTORIAL">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://www.openfoam.com/documentation/guides/latest/doc/nvd-linear.png">
<meta property="article:published_time" content="2021-01-18T01:51:25.000Z">
<meta property="article:modified_time" content="2021-01-19T11:16:07.752Z">
<meta property="article:author" content="Veen">
<meta property="article:tag" content="OpenFOAM">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="https://www.openfoam.com/documentation/guides/latest/doc/nvd-linear.png">
  
  <title>OpenFOAM Notes - Veen</title>

  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4/dist/css/bootstrap.min.css" />


  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/github-markdown-css@4/github-markdown.min.css" />
  <link  rel="stylesheet" href="/lib/hint/hint.min.css" />

  
    
    
      
      
        
          
        
        <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1/themes/prism.min.css" />
      
      
        <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1/plugins/line-numbers/prism-line-numbers.min.css" />
      
    
  

  
    <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3/dist/jquery.fancybox.min.css" />
  


<!-- 主题依赖的图标库，不要自行修改 -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_ba1fz6golrf.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_kmeydafke9r.css">


<link  rel="stylesheet" href="/css/main.css" />

<!-- 自定义样式保持在最底部 -->


  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    var CONFIG = {"hostname":"veenxz.github.io","root":"/","version":"1.8.12","typing":{"enable":true,"typeSpeed":70,"cursorChar":"_","loop":false},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"right","visible":"hover","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"copy_btn":true,"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":0},"lazyload":{"enable":true,"loading_img":"/img/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":false,"baidu":null,"google":null,"gtag":null,"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":null,"app_key":null,"server_url":null,"path":"window.location.pathname"}},"search_path":"/local-search.xml"};
  </script>
  <script  src="/js/utils.js" ></script>
  <script  src="/js/color-schema.js" ></script>
<meta name="generator" content="Hexo 6.3.0"></head>


<body>
  <header style="height: 60vh;">
    <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand" href="/">
      <strong>Veen</strong>
    </a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/">
                <i class="iconfont icon-home-fill"></i>
                首页
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/archives/">
                <i class="iconfont icon-archive-fill"></i>
                归档
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/categories/">
                <i class="iconfont icon-category-fill"></i>
                分类
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/tags/">
                <i class="iconfont icon-tags-fill"></i>
                标签
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/about/">
                <i class="iconfont icon-user-fill"></i>
                关于
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
              &nbsp;<i class="iconfont icon-search"></i>&nbsp;
            </a>
          </li>
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">&nbsp;<i
                class="iconfont icon-dark" id="color-toggle-icon"></i>&nbsp;</a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

    <div class="banner" id="banner" parallax=true
         style="background: url('/img/default.png') no-repeat center center;
           background-size: cover;">
      <div class="full-bg-img">
        <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
          <div class="page-header text-center fade-in-up">
            <span class="h2" id="subtitle" title="OpenFOAM Notes">
              
            </span>

            
          </div>

          
        </div>
      </div>
    </div>
  </header>

  <main>
    
      <div class="container nopadding-x-md">
        <div class="py-5" id="board"
          >
          
          <div class="container">
            <div class="row">
              <div class="col-12 col-md-10 m-auto">
                

<article class="page-content">
  <h1 id="fvSchemes"><a href="#fvSchemes" class="headerlink" title="fvSchemes"></a>fvSchemes</h1><div class="code-wrapper"><pre class="line-numbers language-bash" data-language="bash"><code class="language-bash">foamSearch <span class="token variable">$FOAM_TUTORIALS</span> fvSchemes ddtSchemes.default
foamSearch <span class="token variable">$FOAM_TUTORIALS</span> fvSchemes gradSchemes
foamSearch <span class="token variable">$FOAM_TUTORIALS</span> fvSchemes <span class="token string">"divSchemes.div(phi,U)"</span>
foamSearch <span class="token variable">$FOAM_TUTORIALS</span> fvSchemes laplacianSchemes.default
foamSearch <span class="token variable">$FOAM_TUTORIALS</span> fvSchemes interpolationSchemes.default
foamSearch <span class="token variable">$FOAM_TUTORIALS</span> fvSchemes snGradSchemes

tree <span class="token variable">$FOAM_SRC</span>/finiteVolume/finiteVolume/ddtSchemes -L <span class="token number">1</span>
tree <span class="token variable">$FOAM_SRC</span>/finiteVolume/finiteVolume/gradSchemes -L <span class="token number">1</span>
tree <span class="token variable">$FOAM_SRC</span>/finiteVolume/finiteVolume/divSchemes -L <span class="token number">1</span>
tree <span class="token variable">$FOAM_SRC</span>/finiteVolume/finiteVolume/laplacianSchemes -L <span class="token number">1</span>
tree <span class="token variable">$FOAM_SRC</span>/finiteVolume/finiteVolume/snGradSchemes -L <span class="token number">1</span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre></div>
<blockquote>
<h2 id="Time-schemes-example"><a href="#Time-schemes-example" class="headerlink" title="Time schemes example"></a>Time schemes <a target="_blank" rel="noopener" href="https://www.openfoam.com/documentation/guides/latest/doc/guide-schemes-time-example.html">example</a></h2></blockquote>
<p>Time schemes define how a property is integrated as a function of time</p>
<script type="math/tex; mode=display">
\frac{\part}{\part t}(\phi)</script><div class="code-wrapper"><pre class="line-numbers language-c++" data-language="c++"><code class="language-c++">ddtSchemes
&#123;
    default         backward;
    default         Crank-Nicolson 0.9; &#x2F;&#x2F;for most condition [0 ~ 1]
    default         Euler;
    default         CoEuler phi rho 0.5;;
    default         SLTS phi rho 0.5;;
    default         Local Euler;
    default         steadyState;
    ddt(phi)        &lt;time scheme&gt;;
&#125;
&#x2F;&#x2F; if divSchemes using &quot;bounded&quot;
&#x2F;&#x2F; ddtSchemes should define &quot;bounded&quot;
&#x2F;&#x2F; default         bounded Euler;<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre></div>
<blockquote>
<p>Backward time scheme</p>
</blockquote>
<ul>
<li>Implicit</li>
<li>Second order</li>
<li>Transient</li>
<li>Boundedness not guaranteed</li>
<li>Conditionally stable</li>
</ul>
<script type="math/tex; mode=display">
\frac{\partial}{\partial t}(\phi)=\frac{1}{\Delta t}\left(\frac{3}{2} \phi-2 \phi^{o}+\frac{1}{2} \phi^{o o}\right)</script><blockquote>
<p>Crank-Nicolson time scheme</p>
</blockquote>
<ul>
<li>Second order</li>
<li>Transient</li>
<li>Bounded</li>
</ul>
<script type="math/tex; mode=display">
\frac{\partial}{\partial t}(\phi)=\frac{\phi-\phi^{o o}}{2 \Delta t}</script><div class="code-wrapper"><pre class="line-numbers language-c++" data-language="c++"><code class="language-c++">ddtSchemes
&#123;
    default         CrankNicolson &lt;coeff&gt;
    ddt(phi)        CrankNicolson &lt;coeff&gt;;
&#125;
&#x2F;&#x2F; 0: Euler
&#x2F;&#x2F; 1: Crank-Nicolson
&#x2F;&#x2F; A value of 0.9 is a good compromise between accuracy and robustness
&#x2F;&#x2F; CrankNicolson ocCoeff &#123; type scale ; scale linearRamp ; duration 1 ; value 0.9 ; &#125;;<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre></div>
<blockquote>
<p>Euler implicit time scheme</p>
</blockquote>
<ul>
<li>Implicit</li>
<li>First order</li>
<li>Transient</li>
</ul>
<script type="math/tex; mode=display">
\frac{\partial}{\partial t}(\phi)=\frac{\phi-\phi^{o}}{\Delta t}</script><blockquote>
<p>Local Euler implicit/explicit time scheme</p>
</blockquote>
<ul>
<li>First order</li>
<li>Pseudo transient, designed for steady cases</li>
<li>Spatially varying, cell-based time scale set by specific Local Time Stepping (LTS) solvers</li>
</ul>
<blockquote>
<p>Steady state time scheme</p>
</blockquote>
<ul>
<li>Steady state</li>
<li>Sets temporal derivative contributions to zero</li>
</ul>
<script type="math/tex; mode=display">
\frac{\part}{\part t}(\phi)=0</script><blockquote>
<h2 id="Interpolation-schemes"><a href="#Interpolation-schemes" class="headerlink" title="Interpolation schemes"></a>Interpolation schemes</h2></blockquote>
<p>Interpolation schemes are used to transform cell-centre quantities to face centres. The operation is used in many of the finite volume calculations, e.g. for the calculation of gradient, divergence, and Laplacian terms.</p>
<div class="code-wrapper"><pre class="line-numbers language-c++" data-language="c++"><code class="language-c++">interpolationSchemes
&#123;
    default         none;
    &lt;equation term&gt; &lt;interpolation scheme&gt;;
&#125;<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span></span></code></pre></div>
<blockquote>
<p><strong>Linear divergence scheme</strong></p>
</blockquote>
<ul>
<li>Second order</li>
<li>Unbounded</li>
<li>Good choice for LES calculations due to low dissipation</li>
<li>For isotropic meshes</li>
</ul>
<script type="math/tex; mode=display">
ϕ_f=0.5(ϕ_c+ϕ_d)</script><p><img src="https://www.openfoam.com/documentation/guides/latest/doc/nvd-linear.png" srcset="/img/loading.gif" lazyload alt=""></p>
<div class="code-wrapper"><pre class="line-numbers language-c++" data-language="c++"><code class="language-c++">divSchemes
&#123;
    default         none;
    div(phi,U)      Gauss linear;
    div(phi,U)      cubic;    &#x2F;&#x2F; DNS case
&#125;<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre></div>
<blockquote>
<h2 id="Gradient-schemes-example"><a href="#Gradient-schemes-example" class="headerlink" title="Gradient schemes example"></a>Gradient schemes <a target="_blank" rel="noopener" href="https://www.openfoam.com/documentation/guides/latest/doc/guide-schemes-gradient-example.html">example</a></h2></blockquote>
<p>The gradient of a scalar property <script type="math/tex">\phi</script> is represented using the notation:</p>
<script type="math/tex; mode=display">
\nabla \phi=\mathbf{e}_{1} \frac{\partial}{\partial x_{1}} \phi+\mathbf{e}_{2} \frac{\partial}{\partial x_{2}} \phi+\mathbf{e}_{3} \frac{\partial}{\partial x_{3}} \phi</script><div class="code-wrapper"><pre class="line-numbers language-c++" data-language="c++"><code class="language-c++">gradSchemes
&#123;
    default         none;
    grad(p)         &lt;optional limiter&gt; &lt;gradient scheme&gt; &lt;interpolation scheme&gt;;
&#125;
&#x2F;&#x2F; &lt;limiters&gt; cellLimited cellMDLimited faceLimited faceMDLimited clippedLinear
&#x2F;&#x2F; &lt;gradient scheme&gt; fourth gauss leastSquares 
&#x2F;&#x2F; &lt;interpolation scheme&gt; linear pointLinear leastSquares<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre></div>
<blockquote>
<h2 id="Laplacian-schemes"><a href="#Laplacian-schemes" class="headerlink" title="Laplacian schemes"></a>Laplacian schemes</h2></blockquote>
<p>Taking the Laplacian of a property <script type="math/tex">ϕ</script> is represented using the notation:</p>
<script type="math/tex; mode=display">
\nabla^2 \phi= \frac{\partial ^2}{\partial x_{1}^2} \phi+ \frac{\partial ^2}{\partial x_{2}^2} \phi+ \frac{\partial ^2}{\partial x_{3}^2} \phi</script><p>or as a combination of divergence and gradient operators</p>
<script type="math/tex; mode=display">
\nabla \cdot(\Gamma \nabla \phi)</script><p>where <script type="math/tex">Γ</script> is a diffusion coefficient.</p>
<div class="code-wrapper"><pre class="line-numbers language-c++" data-language="c++"><code class="language-c++">laplacianSchemes
&#123;
    default         none;
    default         Gauss linear;
    default         Gauss linear corrected;
    default         Gauss linear corrected;
    default         Gauss linear corrected;
    laplacian(gamma,phi) Gauss &lt;interpolation scheme&gt; &lt;snGrad scheme&gt;
&#125;<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre></div>
<blockquote>
<h2 id="Divergence-schemes-example"><a href="#Divergence-schemes-example" class="headerlink" title="Divergence schemes example"></a><strong>Divergence schemes</strong> <a target="_blank" rel="noopener" href="https://www.openfoam.com/documentation/guides/latest/doc/guide-schemes-divergence-example.html">example</a></h2></blockquote>
<p>The divergence of a property Q describes the net rate at which it changes as a function of space, represented using the notation:</p>
<script type="math/tex; mode=display">
\nabla \cdot Q</script><div class="code-wrapper"><pre class="line-numbers language-c++" data-language="c++"><code class="language-c++">wallDist
&#123;
    method meshWave;

    &#x2F;&#x2F; Optional entry enabling the calculation
    &#x2F;&#x2F; of the normal-to-wall field
    nRequired false;

    &#x2F;&#x2F; Optional entry delaying wall distance update to every n steps
    &#x2F;&#x2F; Default is 1 (update every step)
    updateInterval 5;
&#125;<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre></div>


  
</article>

              </div>
            </div>
          </div>
        </div>
      </div>
    

    
      <a id="scroll-top-button" aria-label="TOP" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v"
                 for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>
    

    
  </main>

  <footer class="text-center mt-5 py-3">
  <div class="footer-content">
     <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a> <font size="3" face="" color="#2f4154"> <p class="copyright text-muted"> Copyright © Veen 2021 <br> Find me on <a href="https://github.com/Veenxz" target="_blank">GitHub</a> | <a href="https://creativecommons.org/licenses/by-sa/4.0/deed.zh" target="_blank"> <img src="https://d33wubrfki0l68.cloudfront.net/3031be41e8753c70508aa88e84ed8f4f653f157e/d2d9a/images/cc-by-nc-sa.svg" srcset="/img/loading.gif" lazyload alt="Creative Commons"> </a> </p> </font> <div> <span id="timeDate">载入天数...</span> <span id="times">载入时分秒...</span> <script src="/js/duration.js"></script> </div> 
  </div>
  
  <div class="statistics">
    
    

    
      
        <!-- 不蒜子统计PV -->
        <span id="busuanzi_container_site_pv" style="display: none">
            总访问量 
            <span id="busuanzi_value_site_pv"></span>
             次
          </span>
      
      
        <!-- 不蒜子统计UV -->
        <span id="busuanzi_container_site_uv" style="display: none">
            总访客数 
            <span id="busuanzi_value_site_uv"></span>
             人
          </span>
      
    
  </div>


  

  
</footer>


  <!-- SCRIPTS -->
  
  <script  src="https://cdn.jsdelivr.net/npm/nprogress@0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/nprogress@0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js" ></script>
<script  src="https://cdn.jsdelivr.net/npm/bootstrap@4/dist/js/bootstrap.min.js" ></script>
<script  src="/js/events.js" ></script>
<script  src="/js/plugins.js" ></script>

<!-- Plugins -->


  <script  src="/js/local-search.js" ></script>



  
    <script  src="/js/img-lazyload.js" ></script>
  



  
    
  



  
    <script  src="https://cdn.jsdelivr.net/npm/tocbot@4/dist/tocbot.min.js" ></script>
  
  
    <script  src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3/dist/jquery.fancybox.min.js" ></script>
  
  
    <script  src="https://cdn.jsdelivr.net/npm/anchor-js@4/anchor.min.js" ></script>
  
  
    <script defer src="https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js" ></script>
  



  <script defer src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js" ></script>




  <script  src="https://cdn.jsdelivr.net/npm/typed.js@2/lib/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var title = document.getElementById('subtitle').title;
      
      typing(title)
      
    })(window, document);
  </script>















<!-- 主题的启动项 保持在最底部 -->
<script  src="/js/boot.js" ></script>


</body>
</html>
